package com.lagou.service.impl;

import com.lagou.service.TPMonitorService;
import org.apache.dubbo.config.annotation.Service;

import java.security.SecureRandom;
import java.util.concurrent.TimeUnit;

@Service
public class TPMonitorServiceImpl implements TPMonitorService {
    @Override
    public String methodA(String name, int timeToWait) {
        try {
            TimeUnit.MILLISECONDS.sleep(new SecureRandom().nextInt(101));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return name;
    }

    @Override
    public String methodB(String name, int timeToWait) {
        try {
            TimeUnit.MILLISECONDS.sleep(new SecureRandom().nextInt(101));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return name;
    }

    @Override
    public String methodC(String name, int timeToWait) {
        try {
            TimeUnit.MILLISECONDS.sleep(new SecureRandom().nextInt(101));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return name;
    }
}
